package com.example.zq.player.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.zq.player.R;
import com.example.zq.player.linked_database_interface.base.BaseActivity;
import com.example.zq.player.linked_database_interface.shoppingprocess.Product;

public class ProductActivity extends BaseActivity {

    Product product;
    ImageView iv_product_photo;
    TextView  tv_product_price;
    TextView tv_product_describe;
    Button btn_product_add_cart;
    Button btn_product_direct_purchase;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int initLayout() {
        return R.layout.product;
    }

    @Override
    public void initView() {
        iv_product_photo= (ImageView) findViewById(R.id.iv_product_photo);
        tv_product_price= (TextView) findViewById(R.id.tv_product_price);
        tv_product_describe=(TextView) findViewById(R.id.tv_product_describe);
        btn_product_add_cart=(Button)findViewById(R.id.btn_product_add_cart);
        btn_product_direct_purchase=(Button)findViewById(R.id.btn_product_direct_purchase);

    }

    @Override
    public void initData() {
        product = new Product(R.drawable.product_59,33,"过来上课高速路口");
        iv_product_photo.setImageResource(R.drawable.product_8);
        tv_product_price.setText(product.getPrice()+"");
        tv_product_describe.setText(product.getDescribe());

    }
}
